package com.zhangyi.recrprise.controller;

import com.zhangyi.common.domain.Candidate;
import com.zhangyi.common.domain.EnterpriseRecruitment;
import com.zhangyi.common.domain.Result;
import com.zhangyi.recrprise.service.EnterpriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("recruit")
@RestController
public class EnterpriceController {

    @Autowired
    EnterpriceService enterpriceService;


    @PostMapping("/enterprice")//企业招聘列表 需要添加和修改候补人数
    public Result enterpricelist(@RequestBody EnterpriseRecruitment enterpriseRecruitment){
        return enterpriceService.enterpricelist(enterpriseRecruitment);
    }

    @PostMapping("/candidates")//候选人列表 需要添加 只需要修改候选人数
    public Result candidateslist(Candidate candidate){
        return enterpriceService.candidateslist(candidate);
    }

    @PostMapping("/add")//候选人列表添加
    public Result add(@RequestBody Candidate candidate){
        return enterpriceService.add(candidate);
    }

    @PostMapping("/update")//企业招聘列表的修改候补人数
    public Result update(@RequestBody EnterpriseRecruitment enterpriseRecruitment){
        return enterpriceService.update(enterpriseRecruitment);
    }

}
